<template>
<div>
 <el-switch v-model="value" v-bind="elProps" @change="change" />
</div>
</template>

<script setup>
import { ref,watch } from "vue";
const props = defineProps({
  elProps: Object,
  modelValue: Boolean,
});

const value = ref(null);
value.value = props.modelValue;
watch(()=>props.modelValue,(newval)=>{
value.value = newval
})
const emit = defineEmits(["update:modelValue"]);
const change = () => {
  emit("update:modelValue", value.value);
};
</script>

<style lang='scss' scoped>
</style>